import type { FormSchemaGetter } from '#/adapter/form';
import type { VxeGridProps } from '#/adapter/vxe-table';

export const querySchema: FormSchemaGetter = () => [
  {
    component: 'Input',
    fieldName: 'familyName',
    label: '家庭名称',
  },
];

export const columns: VxeGridProps['columns'] = [
  { type: 'checkbox', width: 60 },
  {
    title: '家庭名称',
    field: 'familyName',
  },
  {
    title: '家庭成员',
    field: 'familyMemberName',
  },
  {
    field: 'action',
    fixed: 'right',
    slots: { default: 'action' },
    title: '操作',
    width: 220,
  },
];

export const drawerSchema: FormSchemaGetter = () => [
  {
    label: '家庭id',
    fieldName: 'familyId',
    component: 'Input',
    rules: 'required',
    dependencies: {
      show: () => false,
      triggerFields: [''],
    },
  },
  {
    label: '家庭名称',
    fieldName: 'familyName',
    component: 'Input',
    rules: 'required',
  },
  {
    label: '备注',
    fieldName: 'remark',
    component: 'Textarea',
  },
];
